﻿<#include "layout.ftl"/>
<#macro script_import>

<script src="${staticPath}/js/bootstrapvalidator.min.js"></script>

<!--Bootbox Modals [ OPTIONAL ]-->
<script src="${staticPath}/js/bootbox.min.js"></script>
<!--Modals [ SAMPLE ]-->
<script src="${staticPath}/js/ui-modals.js"></script>
<!--DateTime [ SAMPLE ]-->
<script src="${staticPath}/js/moment.js"></script>
<script src="${staticPath}/js/bootstrap-datetimepicker.min.js"></script>

<script src="${staticPath}/page-js/customer_edit.js"></script>
</#macro>
<#macro css_import>
<link href="${staticPath}/css/bootstrapvalidator.min.css" rel="stylesheet">
<link href="${staticPath}/css/bootstrap-datetimepicker.min.css" rel="stylesheet">

<link href="${staticPath}/css/animate.min.css" rel="stylesheet">
<link href="${staticPath}/css/magic-check.min.css" rel="stylesheet">

</#macro>
<#macro script>

</#macro>

<@layout>


<!--CONTENT CONTAINER-->
<!--===================================================-->
<div id="content-container">

    <!--Page Title-->
    <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
    <div id="page-title">
        <h1 class="page-header text-overflow">修改客户</h1>

        <!--Searchbox-->
        <div class="searchbox">
            <div class="input-group custom-search-form">
                <input type="text" class="form-control" placeholder="Search..">
                            <span class="input-group-btn">
                                <button class="text-muted" type="button"><i class="demo-pli-magnifi-glass"></i></button>
                            </span>
            </div>
        </div>
    </div>
    <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
    <!--End page title-->


    <!--Breadcrumb-->
    <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
    <ol class="breadcrumb">
        <li><a href="#">首页</a></li>
        <li><a href="#">客户管理</a></li>
        <li class="active">修改</li>
    </ol>
    <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
    <!--End breadcrumb-->


    <!--Page content-->
    <!--===================================================-->

    <#if customer??>

        <div id="page-content">
            <div class="panel">
                <div class="panel-heading">
                    <h3 class="panel-title">基础信息</h3>
                </div>

                <form id="customer-form" class="form-horizontal">
                    <div class="panel-body">
                        <input type="hidden" name="id" value="${customer.id!}">
                        <!--NOT EMPTY VALIDATOR-->
                        <!--===================================================-->
                        <fieldset>
                            <div class="form-group">
                                <label class="col-lg-3 control-label">姓名</label>
                                <div class="col-lg-7">
                                    <input type="text" class="form-control" name="name" value="${customer.name!}" placeholder="姓名">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-lg-3 control-label">电话</label>
                                <div class="col-lg-7">
                                    <input type="text" class="form-control" name="phone" value="${customer.phone!}"
                                           placeholder="010 1234567 / 0817 1234567 / 13012345678">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-lg-3 control-label">公司</label>
                                <div class="col-lg-7">
                                    <input type="text" class="form-control" name="company" value="${customer.company!}" placeholder="公司名称">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-lg-3 control-label">网址</label>
                                <div class="col-lg-7">
                                    <input type="text" class="form-control" name="url" value="${customer.url!}" placeholder="公司网址">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-lg-3 control-label">是否加提醒</label>
                                <div class="col-lg-7">
                                    <div class="input-group">

                                    <span class="input-group-addon">
                                        <input id="enableAlert" class="magic-checkbox" type="checkbox" checked="${customer.enableAlert?string('true','false')}" value="${customer.enableAlert?string("1","0")}"
                                               name="enableAlert">
                                        <label for="enableAlert"></label>
                                    </span>
                                        <div class='input-group date' id='datetimepicker'>
                                            <input type='text' name="alertDate" id="alertDate" disabled=true value="<#if customer.alertDate??>${(customer.alertDate)?string('yyyy-MM-dd HH:mm:ss')}</#if> "
                                                   class="form-control"/>
                                    <span class="input-group-addon">
                                        <span class="glyphicon glyphicon-calendar"></span>
                                    </span>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-lg-3 control-label">备注</label>
                                <div class="col-lg-7">
                            <textarea placeholder="备注" name="remark" rows="5" value="${customer.remark!}"
                                      class="form-control">
${customer.remark!}
                            </textarea>
                                </div>
                            </div>

                        </fieldset>
                        <!--===================================================-->

                        <br>


                    </div>
                    <div class="panel-footer">
                        <div class="row">
                            <div class="col-sm-7 col-sm-offset-3">
                                <button class="btn btn-mint" type="button" id="submit">Submit</button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>

        </div>
        <!--===================================================-->
        <!--End page content-->
    <#else>
        <div class="alert alert-danger">
            <strong>抱歉!</strong> 未查询到该条数据.<span><a href="/admin/customer/list" class="alert-link">返回列表</a></span>
        </div>

    </#if>

</div>
<!--===================================================-->
<!--END CONTENT CONTAINER-->


</@layout>
